import request from "@/utils/request.js"

// 上传
export function upload(data) {
	return request("business/bloodPreResults/save", 'POST', data)
}

// 创建血压记录
export function createBloodPressureRecord(data) {
	return request("business/bloodPreResults/save", 'POST', data, {
		'Content-Type': 'application/json; charset=UTF-8'
	})
}

// 上传新的血压测量结果
export function uploadNewResult(data) {
	return request("business/bloodPreResults/uploadNewResult", 'POST', data, {
		'Content-Type': 'application/json; charset=UTF-8'
	})
}

// 批量上传血压记录
export function batchUploadResults(ids, deviceName = '') {
	return request("business/bloodPreResults/batchUploadResults", 'POST', 
		 ids
	, {
		'Content-Type': 'application/json'
	});
}

// 查询分页列表
export function queryListPage(data) {
	return request("business/bloodPreResults/queryListPage", 'POST', data)
}

// 保存设备信息
export function saveDeviceInfo(data) {
	return request("business/deviceInfo/save", 'POST', data, {
		'Content-Type': 'application/json; charset=UTF-8'
	})
}

// 查询设备信息列表
export function queryDeviceInfoList(data) {
	return request("business/deviceInfo/queryListPage", 'POST', data, {
		'Content-Type': 'application/json; charset=UTF-8'
	})
}

// 根据条码号查询用户信息
export function getUserInfoByBarCode(barCode) {
	return request(`business/bloodPreResults/getBarCode?barCode=${barCode}`, 'GET')
}

// 获取AI智能上传结果
export function getAiSubmitResult() {
	return request("business/bloodPreResults/getAiSubmitResult", 'POST', {}, {
		'Content-Type': 'application/json; charset=UTF-8'
	})
}

// AI智能上传确认
export function aiSubmit() {
	return request("business/bloodPreResults/aiSubmit", 'POST', {}, {
		'Content-Type': 'application/json; charset=UTF-8'
	})
}
// 批量删除血压记录
export function deleteBatchResults(ids) {
  return request("business/bloodPreResults/delBatch", 'POST',
	ids, 
    {
      'Content-Type': 'application/json; charset=UTF-8'
    });
}